

export default {
  name: 'mapFolderItem',
  props: {
    // 绑定数据
    map: {
      type: Object,
      default () {
        return {}
      }
    },
    selectedId: {
      type: String,
      default: null
    }
  },
  data () {
    return {
      // 是否展示子节点
      isChildrenShow: false,
    }
  },
  computed: {
    iconType () {
      if (this.isChildrenShow) {
        return 'ios-remove-circle-outline'
      }
      return 'ios-add-circle-outline'
    }
  },
  methods: {
    showChildren () {
      this.isChildrenShow = !this.isChildrenShow
    },
    
    selectHandler (e, id) {
      this.$emit('on-select', e.innerHTML, id)
    },
    
    onSelect (name, id) {
      this.$emit('on-select', name, id)
    }
  }
}